﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace XRM.Security.DataAccess.Models
{
    [Table("UserHistory")]
    public class UserHistory
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int UserHistoryId { get; set; }

        public int UserRegisterId { get; set; }
        public int SystemUserId { get; set; }
        public int? RequestId { get; set; }

        public DateTime HistoryDate { get; set; }
        [Required]
        public string HistoryText { get; set; }

        public int HistoryGroup { get; set; }

        [ForeignKey("UserRegisterId")]
        public virtual UserRegister UserRegister { get; set; }
        [ForeignKey("SystemUserId")]
        public virtual SystemUser SystemUser { get; set; }
        [ForeignKey("RequestId")]
        public virtual Request Request { get; set; }
    } 
}
